<template>
	<!--就诊卡-->
	<view>
		<view class="photo_card">
			<view class="photo_card_title">
				就诊卡
			</view>
			<view class="photo">
			</view>
		</view>
		<view class="info_card">
			<ul>
				<li><label class="left">姓名</label><span class="right">{{userData.xming0}}</span></li>
				<li><label class="left">证件号</label><span class="right">{{userData.sfzh00}}</span></li>
				<!-- <li><label class="left">年龄</label><span class="right">{{userData}}</span></li> -->
				<li><label class="left">手机号</label><span class="right">{{userData.lxdh00}}</span></li>
				<li><label class="left">关系</label><span class="right">本人</span></li>
				<li><label class="left">性别</label><span class="right">{{userData.xbie00==1?"男":"女"}}</span></li>
			</ul>
		</view>
		<view class="display">
			<label class="left">设为默认</label>
			<view class="right"><switch color="#00CE97" @change="switch1Change" /></view>
		</view> 
		<view class="btn_footer">
		<!-- 	<button @click="updateUser()">修改</button>
			<button>删除</button> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userData:{}
			}
		},
		onShow() {
			if(this.userData.kh0000){
				this.init(this.userData.kh0000);
			}
		},
		onLoad(option) {
			if(option.kh0000){
				this.init(option.kh0000);
			}
		},
		methods: {
			init(kh0000){
				this.userData.kh0000=kh0000;
				let data={
					"kh0000":kh0000,
					"klx000":"3",
					"ywlsh0":""+ new Date().getTime(),
					"funid":"F07.02.02.01"
				}
				uni.showLoading({mask:true,title:"加载中..."})
				this.$postJson("/qnyesb/qnyesbproxy",data,res=>{
					//判断用户不存在档案信息则进行跳转
					if(res.state==0){
						let user=res.data;
						this.userData=res.data;
					}else{
						uni.showToast({
							title:res.message
						})
					}
					uni.hideLoading();
				})
			},
			updateUser(){
				uni.navigateTo({
					url:"../bindInfo/bindInfo?kh0000="+this.userData.sfzh00
				})
			}
		}
	}
</script>

<style>
.photo_card{
	width: 96%;
	background-color: #FFFFFF;
	border-radius: 8px 8px 0px 0px;
	margin: 0 auto;
	top: 5px;
	overflow: hidden;
	display: flow-root;
	padding-bottom: 46px;
	position: relative;
}
.photo_card .photo_card_title{
	width: 100%;
	background-color: #3692FF;
	color: #FFFFFF;
	font-weight: bold;
	text-indent: 1.5em;
	background-image: url(../../static/319@2x.png);
	background-size: 27px 27px;
	background-repeat: no-repeat;
	background-position:6px center;
	padding: 12px;
}
.photo_card .photo{
	background-color: #E0E0E0;
	width: 180px;
	height: 180px;
	margin: 0 auto;
	margin-top: 46px;
}
.info_card{
	width: 92%;
	padding:10px;
	margin:0 auto;
	background-color: #FFFFFF;
	margin-top: 10px;
	display: flow-root;
	
	
}
.info_card ul li{
	float: left;
	width: 100%;
	padding-top: 10px;
	padding-bottom: 10px;
}
.display{
	width: 94%;
	display: flow-root;
	background-color: #FFFFFF;
	margin: 0 auto;
	margin-top: 10px;
	padding: 5px;
	line-height:50px;
}
.btn_footer{
	width: 96%;
	margin: 0 auto;
	margin-top: 5px;
}
.btn_footer button{
	background-color: #FFFFFF;
	color: #999999;
	font-size: 14px;
	width: 100%;
	height: 100%;
	padding: 10px;
}
</style>
